<link  href="/stylesheets/tests.css" type="text/css" rel="stylesheet" media="screen">

<br/>
<p  class="smallNav">机构管理>></p>
<div style="margin: 15px 0 10px 0">
  <%= link_to '创建机构', :controller => "system/org", :action => "new" %>
  <%= link_to '一次创建十个机构', :controller => "system/org", :action => "create_orgs" %>
  <%= link_to '所有帐号', :controller => "system/org", :action => "accounts" %>
</div>
<table class="datalist">
  <tr>
    <th scope="col" width="20">序号</th>
    <th scope="col" width="100">名称</th>
    <th scope="col" width="100">登录名</th>
    <th scope="col" width="100">密码</th>
    <th scope="col" width="100">创建时间</th>
    <th scope="col">电话</th>
    <th scope="col">email</th>
    <th scope="col">允许创建帐户数</th>
    <th colspan="5" scope="col"></th>
  </tr>

  <%
    i = 0
    @users.each do |o|
  %>
    <% if i%2 == 0 %>
  <tr>
    <% else %>
  <tr  class="altrow">
    <% end %>

    <td><%=h o.id %></td>
    <td><%=h o.name %></td>
    <td><%=h o.username %></td>
    <td><%=h o.pass %></td>
    <td><%=h o.created_at.strftime('%Y.%m.%d.%H:%M') %></td>
    <td><%=h o.tel_phone %></td>
    <td><%=h o.email %></td>
    <td><%= o.account_num  %></td>
    <td>
      <%= link_to '量表', {:id => o, :controller => "org", :action => "tests" }%>
      <a onclick="return confirm('确定删除?');" href="/system/org/destroy/<%=o.id%>">删除</a>

    </td>
  </tr>
  <%
    i += 1
    end
  %>
</table>
<br/>

<%=will_paginate(@users ,:prev_label=>'上一页',:next_label=>'下一页',:separator=>" | ") %>\

<br />
<br />
